home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Technotools
/
Technotools (Chestnut CD-ROM)(1993).ISO
/
lang_c
/
cug106
/
csym.lib
< prev
next >
Wrap
Text File
|
1984-06-14
|
5KB
|
176 lines
/* csym.lib
Copyright (C) 1980, M J Maney
First created 3/1/80
Last revised 3/29/80 17:00
This file contains some basic definitions that will be needed, or
at least useful, to the majority of C programs. Some special
purpose libraries may assume that this library file is to be
included in a source file when they are to be used.
*/
/* Common symbolic constants */
#define TRUE 1
#define FALSE 0
#define YES 1 /* note YES is the same as TRUE, and NO is the same */
#define NO 0 /* as FALSE. Sometimes one is clearer than the other */
#define OK 1 /* again, the same as TRUE */
#define ERR -1 /* common, though not universal, signal of distress */
#define FF '\014'
#define NEWLINE '\n'
#define INFILE 0 /* symbols for open() in stdlib */
#define OUTFILE 1
#define IOFILE 2
#define DSKBUF 134 /* size of buffer needed for getc/putc */
#define IOBUFSIZ 134 /* same as DSKBUF, but I like this name better */
#define FNAMSIZ 16 /* can hold any legal filename with '\0' */
#define EOF -1 /* value getc returns on physical end of file */
#define EOT 0x1A /* value CP/M uses to delimit end of ascii files */
/* DANGER !! the next line contains a character that the Hazeltine
does not print, but regards as its 'lead-in', so this will look
sorta funny on the tube !!! ACT prints it ok */
#define #! ~ /* the C complement operator */
#define uint unsigned
/* Symbols used for stdlib files, collected togethere here to
ensure system concistency
*/
#define RAM 0
#define MAXLINE 132
#define NULL 0
/* I prefer the name NIL for a pointer to nothing */
#define NIL 0
/* Symbols for IO devices */
#define CONSOLE 1
#define PRINTER 2
#define READER 3
#define PUNCH 4
#define FILE 100
ret ;else is non-space
PEND ISSPACE
;
;
PROC TOUPPER
lda ARG1
mov l,a
mvi h,0 ;setup to return character unchanged
cpi 'a'
rc ;less than 'a'
cpi 'z'+1
rnc ;greater than 'z'
adi 'A'-'a' ;else is lower-case, convert it
mov l,a To incorporate the changes made by HRM in stdlib1.c
and stdlib2.c into deff.crl and deff2.crl for BDS C ver 1.31,
the following sequence of commands was executed.
note: comments are prefaced by "--"
-- eliminate old versions in deff and make room for new
clib
o 1 deff
d 1 getc
d 1 putc
d 1 fflush
d 1 sscanf
d 1 sprintf
d 1 _uspr
d 1 fgets
c 1 -- save version of deff with space available
^C -- reboot
-- add new versions (plus 1 new function) to deff
clib
o 1 deff
o 2 stdlib1
o 3 stdlib2
t 2 1 getc
t 2 1 putc
t 2 1 fflush
t 2 1 ungetc -- the new one
t 3 1 sscanf
t 3 1 sprintf
t 3 1 _uspr
t 3 1 fgets
c 1 -- permanentize it
^C -- reboot
-- add new routines to deff2
clib
o 1 deff2
o 2 stdlib2
t 2 1 lprintf
t 2 1 pprintf
t 2 1 lputs
t 2 1 pputs
t 2 1 rgets
t 2 1 lputc
t 2 1 pputc
t 2 1 rgetc
c 1 -- permanentize it
^C -- reboot
-- update process is complete
VOLUME CG6
DESCRIPTION:
NUMBER SIZE NAME COMMENTS
CATALOG.CG6 CONTENTS OF CP/M VOL. CG6
HISTORY.CG6 Credits for submissions.
CG6.1 1K BIOSLB.CRL A bios modified by Harvey Moran
CG6.2 4K BIOSLB.MAC
CG6.3 9K BIOSLB.PRN
CG6.4 8K BSPAT1-4.DOC More by Moran on bios tinkering.
CG6.5 3K CHARFUN.ASM Assembly version of library char
manipulation functions.
CG6.6 3K CRL.DOC Macro file to aid in generating
BDS compatible CRL files.
CG6.7 8K CRL.LIB
CG6.8 2K CSYM.LIB Symbol file for above.
CG6.9 1K DEFFMODS.HRM Narrative (tutorial) describing
The modification of Moran's standard
libraries. See STDLIB?.
CG6.10 1K FACT.MOU Factorial program written in MOUSE
CG6.13 13K GRAVT100.C Graphics for the VT100 in ANSI.
CG6.14 9K GRAVT100.CRL
CG6.15 3K IOFUN.ASM Assembly version of C i/o functions.
CG6.16 5K MACHINE.ASM Assembly crl functions, mostly
for manipulating blocks of memory
CG6.17 5K MOUSE.C Interpreter (originally in Pascal)
described in BYTE. Issue date in source
CG6.18 1K NTOI.C Small number crunching functions.
CG6.19 1K OTOI.C
CG6.20 4K PRVLIB.C Misc. functions.
CG6.21 5K QUEUE.C Functions to impliment FIFO's
By Scott Layson
CG6.22 1K STDEF.C Deff file for NTOI,OTOI,GRAVT100,
STRINGS, UTIL1.
CG6.23 4K STDIO.DOC Functions to simulate Unix's i/o
redirection. Written under 1.31 and
never tested in this form.
CG6.24 2K STDIO.LIB
CG6.25 5K STDIO.SRC
CG6.26 7K STDLIB1.C Modified libraries (for ver 1.32 of
BDS C) needed with Mouse, WP.C, XTRINS.
CG6.27 20K STDLIB2.C
CG6.28 4K STRFUN.ASM C string functions implemented in
assembly for efficiency.
CG6.29 5K STRINGS.C String manipulation package.
CG6.30 3K STRINGS.CRL
CG6.31 2K SYSTEM.C Deffs for